{% extends 'base.html' %}

{% block stylesheet %}
{{ block.super }}
{% endblock%}

{% block javascript %}
{{ block.super }}
<script type="text/javascript" src="{% url base_static "js/jquery.tablesorter.min.js" %}"></script>
<script type="text/javascript">
$(document).ready(function(){
    $("#invoice_table").tablesorter();
    $("table.list tr:even").addClass("even");
});
</script>
{% endblock%}

{% load humanize %}
{% block content %}
<h3>Invoice List</h3>
<div id="navi">
    <ul>
        <li><a href="{% url invoice_create %}">invoice create</a></li>
        <li><a href="{% url invoice_year_list_csv "2011" %}">all invoice download</a></li>
    </ul>
</div>

<h3>All Invoice Summary</h3>
<table id="invoice_summary_table" class="tablesorter list">
<thead>
    <tr>
        <th>-</th>
        <th><a href="{% url invoice_month_list 2011 1 %}">Jan</a></th>
        <th><a href="{% url invoice_month_list 2011 2 %}">Feb</a></th>
        <th><a href="{% url invoice_month_list 2011 3 %}">Mar</a></th>
        <th><a href="{% url invoice_month_list 2011 4 %}">Apr</a></th>
        <th><a href="{% url invoice_month_list 2011 5 %}">May</a></th>
        <th><a href="{% url invoice_month_list 2011 6 %}">Jun</a></th>
        <th><a href="{% url invoice_month_list 2011 7 %}">Jul</a></th>
        <th><a href="{% url invoice_month_list 2011 8 %}">Aug</a></th>
        <th><a href="{% url invoice_month_list 2011 9 %}">Sep</a></th>
        <th><a href="{% url invoice_month_list 2011 10 %}">Oct</a></th>
        <th><a href="{% url invoice_month_list 2011 11 %}">Nov</a></th>
        <th><a href="{% url invoice_month_list 2011 12 %}">Dec</a></th>
        <th>Total</th>
    </tr>
</thead>
<tbody>
    <tr>
        <td><b>Total Count Class</b></td>
        {% for up in total_class_count_dic.values %}
        <td>{{ up|intcomma }}</td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>Paid School</b></td>
        {% for p in paid_school_dic.values %}
        <td>{{ p|intcomma }} </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>Paid</b></td>
        {% for p in paid_dic.values %}
        <td>{{ p|intcomma }} </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>Unpaid School</b></td>
        {% for p in unpaid_school_dic.values %}
        <td>{{ p|intcomma }} </td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>Unpaid</b></td>
        {% for up in unpaid_dic.values %}
        <td>{{ up|intcomma }}</td>
        {% endfor %}
    </tr>
    <tr>
        <td><b>Total</b></td>
        {% for tp in total_paid_dic.values %}
        <td>{{ tp|intcomma }}</td>
        {% endfor %}
    </tr>
</tbody>
</table>

{% endblock %}